﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UE.SharePoint.ImportExport.BLL
{
    /// <summary>
    /// Represents a sharepoint link data
    /// </summary>
    public class LinkData
    {
        private object text;
        private Uri url;

        public object Text
        {
            get
            {
                return this.text;
            }
        }

        public Uri Url
        {
            get
            {
                return this.url;
            }
        }

        public LinkData(object text, Uri url)
        {
            this.text = text;
            this.url = url;
        }

        public override string ToString()
        {
            return string.Format("{0}, {1}", this.url.ToString(), this.text);
        }

        public string ToHtml()
        {
            return string.Format("<a href='{0}'>{1}</a>", this.url.ToString(), this.text);
        }

        public string ToPublishingImageFormat()
        {
            return string.Format("<a href=\"{0}\" title=\"{1}\"><img alt=\"\" src=\"{0}\">{1}</a>", this.url.ToString(), this.text);
        }

        public string ToPublishingHyperlinkFormat()
        {
            return string.Format("<a href=\"{0}\" title=\"{1}\">{1}</a>", this.url.ToString(), this.text);
        }
    }
}
